In [1]:
%pylab inline
import plotly.plotly as py
from plotly.graph_objs import *
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode()
Populating the interactive namespace from numpy and matplotlib
In [2]:
math.factorial(5)
Out[2]:
120
In [3]:
def wave_func2(m,l,x,y):
    tmp= 1/(2*pi*l*l*2**m*math.factorial(m))
    tmp=tmp*((x*x+y*y)/l/l)**m*(exp(-(x*x+y*y)/4/l/l))**2
    
    return(tmp)
In [4]:
wave_func2(2,1,3,4)
Out[4]:
4.6337130744172826e-05
In [16]:
npoints=50
xy_lim=4

x,y=meshgrid(linspace(-xy_lim,xy_lim,npoints),linspace(-xy_lim,xy_lim,npoints)) # mintavételezés az x,y síkban


m=2  ###   m quantum number
l=1  ###  magetic length

z=wave_func2(m,l,x,y)# |Psi|^2  az x és y függvényében
In [17]:
iplot(Figure(data=[Surface(x=x,y=y,z=z)]))
In [ ]: